<?php /* Smarty version 2.6.26, created on 2014-02-08 06:40:22
         compiled from stats.tpl.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'count', 'stats.tpl.php', 68, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>


<div class="titleFull">

	<div class="wrapper">

		<h1 style="line-height: 100px; margin: 0px;">Statistics</h1>

	</div>

</div>


<div class="titleBlueBar"></div>




<div class="content2">

	<div class="wrapper">

		<div class="h30"></div>

		<div class="boxLeft2">





				<!--Date Pickers-->
				<form action="stats.php" method="post">

				<table cellspacing="0" style="font-size:13px; width:670px;" class="datearea">
				<tr>
					<td style="width:80px;">Start Date</td> <td><input style="width: 190px;" type="text" name="date1" id="date1" /></td>  <td style="text-align:center; width:85px">End Date</td> <td><input style="width: 190px;" type="text" id="date2" name="date2" /></td><td>&nbsp;<input type="submit" class="buttonsmall" value="View" name="submit" style="vertical-align: top;" /></td>
				</tr>
				</table>

				</form>
				<!--End Date Picker-->

				<script type="text/javascript">
				var today = '<?php echo $this->_tpl_vars['serverDate']; ?>
';

				<?php echo '
				$(document).ready(function(){

				 $(\'#date1\').datepicker({ dateFormat: "yy-mm-dd"});
				 $(\'#date1\').datepicker( "option", "defaultDate", today );
				 $(\'#date2\').datepicker({ dateFormat: "yy-mm-dd"}); 
				 $(\'#date2\').datepicker( "option", "defaultDate", today );

					
				});

				'; ?>

				</script>


				<p style="color:#56565f; margin:10px auto;"><?php if ($this->_tpl_vars['date_start'] != ""): ?>Showing Statistics From &nbsp;| <?php echo $this->_tpl_vars['date_start']; ?>
 <?php endif; ?><?php if ($this->_tpl_vars['date_end'] != ""): ?>- <?php echo $this->_tpl_vars['date_end']; ?>
<?php endif; ?> </p>

				 
				<br>
				<h3>CLICKS/DOWNLOADS</h3>
				<div id="a_chart" style="width:668px;  margin:10px 0;   border:1px solid #bbbbbb;">
				<?php if ($this->_tpl_vars['ldata'] == "" || count($this->_tpl_vars['ldata']) < 1): ?>
				<br />
				<center>Files analytics not available</center>
				<?php endif; ?>
				</div>



				<br />
				<h3>COUNTRY BREAKDOWN</h3>
				<div id="c_map" style="width:668px;  margin:10px 0; border:1px solid #bbbbbb;">
				<?php if ($this->_tpl_vars['country_analytics'] == "" || count($this->_tpl_vars['country_analytics']) < 1): ?>
				<br />
				<center>country breakdown not available</center>
				<?php endif; ?>
				</div>


				<br>
				<h3>PREMIUM EARNINGS</h3>
				<div id="premium_chart" style="width:668px;  margin:10px 0;  border:1px solid #bbbbbb;">
				<?php if ($this->_tpl_vars['pdata'] == "" || count($this->_tpl_vars['pdata']) < 1): ?>
				<br />
				<center>Premium earnings chart not available</center>
				<?php endif; ?>
				</div>


				<br>
				<h3>REFERRERS</h3>
				<table class="table" cellpadding="0" cellspacing="0">
					<tr">
						<th colspan="2">Referrer</th>
						<th>Downloads</th>
				   </tr>


					 <?php if ($this->_tpl_vars['referrers'] != ""): ?>
					
					<?php $_from = $this->_tpl_vars['referrers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['ref']):
?>
					<tr>

					<td colspan="2"><?php echo $this->_tpl_vars['ref']['referrer']; ?>
</td>
					<td ><b><?php echo $this->_tpl_vars['ref']['count']; ?>
</b> Downloads</td>

					</tr>
					<?php endforeach; endif; unset($_from); ?>
				   
					<?php else: ?>
					 <tr style="text-align:center"><td colspan="3">No referrers found.</td></tr>
					
					<?php endif; ?>
					
				</table>




				<br />
				<h3>DETAILED STATISTICS</h3>
				<table class="table" cellpadding="0" cellspacing="0">
					<tr>
						<th>File ID</th>
						<th>Revenue</th>
						<th>Downloads</th>
						<th>Clicks</th>
						<th>Conv</th> 
						<th>AvgCPA</th>         
					    <th>EPC</th>
					</tr>


					<?php if ($this->_tpl_vars['history'] != "" && count($this->_tpl_vars['history']) > 0): ?>
					
					<?php $_from = $this->_tpl_vars['history']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['data']):
?>
					<tr>
					<td><span  title="<?php echo $this->_tpl_vars['data']['file']; ?>
" class="ec-tip-twitter"><?php echo $this->_tpl_vars['data']['id']; ?>
</span></td>
					<td>$<?php echo $this->_tpl_vars['data']['profit']; ?>
</td>
					<td ><?php echo $this->_tpl_vars['data']['downloads']; ?>
</td>
					<td><?php echo $this->_tpl_vars['data']['clicks']; ?>
</td>
					<td><?php echo $this->_tpl_vars['data']['conv']; ?>
%</td>
					<td>$<?php echo $this->_tpl_vars['data']['avgcpa']; ?>
</td>    
					<td>$<?php echo $this->_tpl_vars['data']['epc']; ?>
</td> 
					</tr>
					<?php endforeach; endif; unset($_from); ?>
					<tr style=" font-weight:bold;">
					<td>&nbsp;Total/Average</td>
					<td>$<?php echo $this->_tpl_vars['total_profit']; ?>
</td>
					<td ><?php echo $this->_tpl_vars['total_downloads']; ?>
</td>
					<td><?php echo $this->_tpl_vars['total_clicks']; ?>
</td>
					<td><?php echo $this->_tpl_vars['total_conv']; ?>
%</td>
					<td>$<?php echo $this->_tpl_vars['total_avg']; ?>
</td>    
					<td>$<?php echo $this->_tpl_vars['total_epc']; ?>
</td>
					</tr>       
					<?php else: ?>
					 <tr style="text-align:center"><td colspan="7">Files Aanlytics Not Available.</td></tr>
					
					<?php endif; ?>
					
				 

				</table>




				<br />
				<h3>GATEWAYS STATS</h3>
				<table class="table" cellpadding="0" cellspacing="0">
					<tr>
						<th>Gateway</th>
						<th>Revenue</th>
						<th>Unlocks</th>
						<th>Clicks</th>
						<th>Conv</th> 
						<th>AvgCPA</th>         
						<th>EPC</th>
					</tr>


					<?php if ($this->_tpl_vars['gw_data'] != "" && count($this->_tpl_vars['gw_data']) > 0): ?>
					
					<?php $_from = $this->_tpl_vars['gw_data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['data']):
?>
					<tr>
					<td><span  title="<?php echo $this->_tpl_vars['data']['gw_name']; ?>
" class="ec-tip-twitter"><?php echo $this->_tpl_vars['data']['gw_name']; ?>
</span></td>
					<td>$<?php echo $this->_tpl_vars['data']['profit']; ?>
</td>
					<td ><?php echo $this->_tpl_vars['data']['downloads']; ?>
</td>
					<td><?php echo $this->_tpl_vars['data']['clicks']; ?>
</td>
					<td><?php echo $this->_tpl_vars['data']['conv']; ?>
%</td>
					<td>$<?php echo $this->_tpl_vars['data']['avgcpa']; ?>
</td>    
					<td>$<?php echo $this->_tpl_vars['data']['epc']; ?>
</td> 
					</tr>
					<?php endforeach; endif; unset($_from); ?>
					<tr style=" font-weight:bold;">
					<td>&nbsp;Total/Average</td>
					<td>$<?php echo $this->_tpl_vars['gtotal_profit']; ?>
</td>
					<td ><?php echo $this->_tpl_vars['gtotal_downloads']; ?>
</td>
					<td><?php echo $this->_tpl_vars['gtotal_clicks']; ?>
</td>
					<td><?php echo $this->_tpl_vars['gtotal_conv']; ?>
%</td>
					<td>$<?php echo $this->_tpl_vars['gtotal_avg']; ?>
</td>    
					<td>$<?php echo $this->_tpl_vars['gtotal_epc']; ?>
</td>
					</tr>       
					<?php else: ?>
					 <tr style="text-align:center"><td colspan="7">Gateways Aanlytics Not Available.</td></tr>
					
					<?php endif; ?>
					
				 

				</table>





		</div>


<!--Right Panel-->
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "sidebar.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<!--End Right Panel-->


<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>